#pragma once
#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <assert.h>
using namespace std;

namespace bit 
{
	class string
	{
	public:
		string(const char* str = "");
		~string();

		using iterator = char*;
		using const_iterator = const char*;
		char& operator[](size_t i) 
		{
			assert(i < _size);
			return _str[i];
		}

		char& operator[](size_t i) const
		{
			assert(i < _size);
			return _str[i];
		}

		const size_t size()const
		{
			return _size;
		}
		const char* c_str() const
		{
			return _str;
		}

		iterator begin()
		{
			return _str;
		}
		iterator end()
		{
			return _str + _size;
		}
		const_iterator begin() const
		{
			return _str;
		}
		const_iterator end() const
		{
			return _str + _size;
		}
	private:
		char* _str;
		size_t _size;
		size_t _capacity;
	};
}
